
		package Lesson4;

		import java.util.Scanner;

		public class Class5TaskSix {

			public static void main(String[] args) {

				Scanner sc = new Scanner(System.in);
				
					System.out.println(" Enter the length of the array");
				int length = sc.nextInt();
				
				int [][] arr = new int [length][length];
				int element;
				int save = 0;
				
				for(int i = 0; i < arr.length; i++)
				{
					for(int j = 0; j < arr[i].length; j++)
					{
						System.out.println(" Enter element on row " + i);	
					element = sc.nextInt();
					arr[i][j] = element;	
					
					}
				}
				
				for(int i = 0; i < arr.length; i++)
				{
					for(int j = 0; j < arr[i].length; j++)
					{
						if (i==j)
						{
							System.out.print(arr[i][j]+" ");
							
							
						}
					}
				}
				
				
				
				
				
				
			}

		}

